package com.byx.chatclient.emoji;

import com.byx.chatclient.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * EmojiAdapter
 *
 * @author Superb
 * @date 2021/3/28 15:19
 */
public class EmojiAdapter extends BaseQuickAdapter<EmojiBean, BaseViewHolder> {
    public EmojiAdapter(@Nullable List<EmojiBean> data,int index,int pageSize) {
        super(R.layout.item_emoji, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, EmojiBean emojiBean) {
        //判断是否为最后一个item
        if (emojiBean.getId()==0) {
            baseViewHolder.setBackgroundResource(R.id.tv_emoji,R.mipmap.rc_icon_emoji_delete);
        } else {
            baseViewHolder.setText(R.id.tv_emoji,emojiBean.getUnicodeInt() );
        }
    }
}
